<?php $this->load->helper('form');
//Programer note:	ID attributes used for client-side operations. (ID follows modular '_camelCase' control naming convention).
//Name attribute is used for Posting/Data operations.	(Name follows field name from database convention) 
?>
<!DOCTYPE html>
<html>
	<head>
		<title><?php echo $title;?></title>
		<?php echo link_tag('css/ppharm_popup.css'.'?'.time());?>  
		<?php echo link_tag('css/custom-theme/jquery-ui-1.8.2.custom.css'.'?'.time());?>
		<script type="text/javascript" src="<?php echo base_url().('/js/jquery.min.js');?>"></script>
		<script type="text/javascript" src="<?php echo base_url().('/js/jquery-ui.min.js');?>"></script>
		<script type="text/javascript" src="<?php echo base_url().('/js/common_form_functions.js').'?'.time();//TODO:  Version this once complete. Must timestamp so it will always update from cache?>"></script>
		<script type="text/javascript">
			$(document).ready(function() {	
					$("#_close").click(function() {
							window.opener.location.reload();
							window.close();
							return false;
							});

					<?php echo isset($additional_javascript_doc_ready_functions) ? $additional_javascript_doc_ready_functions : '' ; ?>


		});
		
		<?php echo isset($additional_jquery_javascript) ? $additional_jquery_javascript : '' ; ?>

		function my_url()
		{
			return '<?php echo site_url(); //Needed to reference website from javascript?>';
		}
		</script>
	</head>

	<body>
	
		<div class = "ppg-logo">
			<image src="<?php echo base_url().'/images/ppharmlogo.jpg';?>"/>
		</div>
		<div class="facility-name">
			<span style="padding-right: 350px; font-family: Arial, 'Trebuchet MS', sans-serif; font-size: 22px;">
				<?php echo $heading;?>
			</span>
			&nbsp;
		</div>
		<div class = "clear-class"></div>
	
	<?php echo form_fieldset('','class = "small-popup-frameset"');?>
	<?php echo validation_errors(); ?>
	
	<?php 
	$this->load->helper('form');
	echo form_open('facility/'.$save_type, array('id'=>'_facilityForm'));
	?>
	
	
	<div>
		<?php //echo form_hidden('facility_id', $facility_id);?>
		<input type="hidden" name="facility_id" id="id" value="<?php echo $facility_id;?>" />
	
				 
			<?php echo form_label('Facility Name:', '_facilityName');?>
				<input type="text" id="_facilityName" name = "facility_name" value="<?php echo set_value('facility_name', $facility_name); ?>" size="50" autocomplete="off" />
				<br class="clear" />
				
		<?php echo form_label('URL:', '_facilitySiteUrl');?>
				<input type="text" id="_facilitySiteUrl" name = "facility_site_url" value="<?php echo set_value('SharePoint URL:', $facility_site_url); ?>" size="50" autocomplete="off" />
				<br class="clear" />
		<?php echo form_label('Active:', '_active');?>
		<?php echo form_checkbox($active_checkbox);?>
		<br class="clear" />

	</div> 
	<div class="small-popup-button-class"> 
		<input name="save" id="_save" type="submit"	value="Ok"/>
		<button name="close" id="_close" />Close</button>
	</div>
	<?php echo form_fieldset_close(); //Small Pop-up Fieldset ?>

		
	<div class="navigation-bar">
	<?php echo isset($nav_bar) ? $nav_bar : '' ; ?>
	</div>
		
	<?php	echo form_close(); ?>
	<div class="footer">
		<?php echo form_label('Date added:', '_createdDate');?><input type="text" id="_createdDate" name = "created_date" readonly="readonly" tabindex="-1" value="<?php echo set_value('created_date', $created_date); ?>" size="50" autocomplete="off" />		
		<?php echo form_label('Last Modified:', '_modifiedDate');?><input type="text" id="_modifiedDate" name = "modified_date" readonly="readonly" tabindex="-1" value="<?php echo set_value('modified_date', $modified_date); ?>" size="50" autocomplete="off" />
	</div>	
	</body>
</html>
